import 'package:flutter/material.dart';
import 'package:flutter_swiper_view/flutter_swiper_view.dart';

const List<String> defautImages=[
  'https://img.shetu66.com/2023/03/10/1678416892458199.jpg',
  'https://img.shetu66.com/2023/07/04/1688452147066774.png',
  'https://bpic.588ku.com/element_origin_min_pic/23/07/11/d32dabe266d10da8b21bd640a2e9b611.jpg!r650'
];

class CommonSwiper extends StatelessWidget {
  final List<String> images;
  const CommonSwiper({super.key, this.images=defautImages});

  @override
  Widget build(BuildContext context) {
    var height = MediaQuery.of(context).size.width/1024*683;
    return Container(
      height: height,
      child:  Swiper(
        itemBuilder: (BuildContext context,int index){
          return new Image.network(images[index],fit: BoxFit.fill,);
        },
        autoplay: true,
        itemCount: images.length,
        pagination: new SwiperPagination(),
        // control: new SwiperControl(),
      ),
    );
  }
}